import { PetEquipTooltipInfo } from "../../../resource/info/PetEquipTooltipInfo";
import { GTextFormat } from "../../../../common/GTextFormat";
import { FontUtil } from "../../../../common/font/FontUtil";
import { SuitConfig } from "../../../resource/SuitConfig";
import { SuitInfo } from "../../../resource/info/SuitInfo";
import { HTMLUtil } from "../../../../../com/gengine/utils/HTMLUtil";
import { ColorConfig } from "../../../resource/ColorConfig";
import { EBind } from "../../../../../Message/Public/EBind";
import { GlobalClass } from "../../../../../com/mui/core/GlobalClass";
import { ImagesConst } from "../../../resource/ImagesConst";
import { GameDefConfig } from "../../../resource/GameDefConfig";
import { DisplayUtil } from "../../../../common/DisplayUtil";
import { ObjCreate } from "../ObjCreate";
import { GlobalStyle } from "../../../../common/global/GlobalStyle";
import { Language } from "../../../../../extend/language/Language";
import { EquipmentItemDataUtil } from "../EquipmentItemDataUtil";
import { TItemWeapon } from "../../../../../Message/Db/Tables/TItemWeapon";
import { BaseItem } from "../BaseItem";
import { PetEquipStars } from "../../petEquipment/deploy/PetEquipStars";
import { EColor } from "../../../../../Message/Public/EColor";
import { ParamsConst } from "../../../../common/global/ParamsConst";
import { ProxyType } from "../../../../common/global/ProxyType";
import { PetUtil } from "../../pet/info/PetUtil";
import { ItemData } from "../../../resource/info/ItemData";
import { ItemConfig } from "../../../resource/ItemConfig";
import { GTextFiled } from "../../../../../com/mui/controls/GTextFiled";
import { ItemInfo } from "../../../resource/info/ItemInfo";
import { ItemExInfo } from "../../../resource/info/ItemExInfo";
type int = number;
//class PetEquipTooltip
    
    export  class PetEquipTooltip /* flash.display.Sprite */
    {
        constructor(arg1: PetEquipTooltipInfo)
        {
            
            this._gemTf = new GTextFormat(FontUtil.songtiName, 12, 41727);
            this.initUI();
            this.data = arg1;
            return;
        }

        public getSuitText(): string
        {
            var loc12=null;
            var loc13=null;
            var loc14=0;
            var loc15=null;
            var loc16=null;
            var loc17=0;
            var loc18=null;
            var loc19=null;
            var loc1="";
            var loc2="";
            var loc3=[];
            var loc4=[];
            var loc5="";
            var loc6=[];
            var loc7="";
            var loc8="";
            var loc9=0;
            var loc10=0;
            var loc11=new Map<any, any> /* flash.utils.Dictionary */();
            if (this._tItemWeap) 
            {
                if (this._tItemWeap.suit != 0) 
                {
                    if (loc12 = SuitConfig.instance.getInfoByCode(this._tItemWeap.suit)) 
                    {
                        loc10 = (loc13 = new SuitInfo(loc12)).num;
                        loc3 = loc13.partList;
                        loc4 = loc13.partIdList;
                        loc14 = 0;
                        while (loc14 < loc3.length) 
                        {
                            loc18 = "";
                            loc19 = "";
                            if (loc14 == 4) 
                            {
                                loc18 = "\r";
                            }
                            if (loc14 == 0 || loc14 == 4) 
                            {
                                loc19 = "    ";
                            }
                            loc5 = loc5 + (loc19 + HTMLUtil.addColor(loc3[loc14], "#7c7c7c") + "  " + loc18);
                            ++loc14;
                        }
                        loc9 = loc9 > loc12.num ? loc12.num : loc9;
                        loc15 = ColorConfig.instance.getItemColorString(this._tItemWeap.color);
                        loc2 = HTMLUtil.addColor(loc12.name + "（" + loc9 + "/" + loc12.num + "）", loc15);
                        loc17 = 1;
                        while (loc17 <= loc10) 
                        {
                            if ((loc16 = loc13.addAttrArray[(loc17 - 1)]) != "") 
                            {
                                if (loc17 <= loc9) 
                                {
                                    loc7 = loc7 + HTMLUtil.addColor("    （" + loc17 + "）" + loc16 + "\r", "#f0ea3f");
                                }
                                else 
                                {
                                    loc7 = loc7 + HTMLUtil.addColor("    （" + loc17 + "）" + loc16 + "\r", "#7c7c7c");
                                }
                            }
                            ++loc17;
                        }
                        loc8 = loc12.attrSkill;
                        loc1 = loc2 + "\r" + loc5 + "\r" + loc7;
                    }
                }
            }
            if (loc1 != "") 
            {
                loc1 = "<textFormat leading=\'5\'>" + loc1 + "</textFormat>";
            }
            return loc1;
        }

        /* internal  */updateUI(): void
        {
            this._currentY = 0;
            this._qualityTxt.htmlText = this.getQualityName();
            this._nameTxt.htmlText = this.getNameText() + this.getStrengName();
            this._currentY = this._currentY + this._nameTxt.height;
            var loc1=this.getBind();
            if (loc1 != EBind._EBindYes) 
            {
                this._lockBitmap.bitmapData = null;
                this._bindTxt.x = 7;
            }
            else 
            {
                this._lockBitmap.bitmapData = GlobalClass.getBitmapData(ImagesConst.EqBind);
                this._lockBitmap.y = this._currentY + 2;
                this._bindTxt.x = 25;
            }
            this._bindTxt.text = GameDefConfig.instance.getEBind(loc1).name;
            this._bindTxt.y = this._currentY;
            this._currentY = this._currentY + this._bindTxt.height;
            this._imageBg.x = this._leftX + 5;
            this._imageBg.y = this._currentY + 8;
            this._eqItem.itemData = this._itemData;
            this._eqItem.x = this._imageBg.x + 3;
            this._eqItem.y = this._imageBg.y + 3;
            this._needLevelTxt.htmlText = this.getNeedLevelStr();
            this._needLevelTxt.y = this._currentY;
            this._currentY = this._currentY + this._needLevelTxt.height;
            this._eqTypeTxt.htmlText = this.getEqType();
            this._eqTypeTxt.y = this._currentY;
            this._currentY = this._currentY + this._eqTypeTxt.height;
            this._durabTxt.htmlText = this.getDurab();
            this._durabTxt.y = this._currentY;
            this._currentY = this._currentY + this._durabTxt.height;
            this._equipStar.starNum = this.getEquipStar();
            this._equipStar.y = this._currentY;
            this._currentY = this._currentY + 20;
            this._basicPropTxt.htmlText = this.getBasicProps();
            this._basicPropTxt.y = this._currentY;
            this._currentY = this._currentY + this._basicPropTxt.height;
            this._baseLine.y = this._currentY;
            this._currentY = this._currentY + (this._baseLine.height + 2);
            if (this._data.isShowAddAttr) 
            {
                this._addtionalPropTxt.htmlText = this.getAddtionalProps();
                this._addtionalPropTxt.y = this._currentY;
                this._currentY = this._currentY + this._addtionalPropTxt.height;
                this._addLine.y = this._currentY;
                this._currentY = this._currentY + (this._addLine.height + 2);
                this.addChild(this._addLine);
            }
            else 
            {
                this._addtionalPropTxt.htmlText = "";
                DisplayUtil.removeMe(this._addLine);
            }
            if (this._data.isShowInlayAttr) 
            {
                this._gemTxt.htmlText = this.getInlay();
                this._gemTxt.y = this._currentY;
                this._currentY = this._currentY + this._gemTxt.height;
                this.updateGemSprite();
                this._gemLine.y = this._currentY;
                this._currentY = this._currentY + (this._gemLine.height + 2);
                this.addChild(this._gemLine);
            }
            else 
            {
                this._gemTxt.htmlText = "";
                this.updateGemSprite();
                DisplayUtil.removeMe(this._gemLine);
            }
            if (this._data.isHidedAttr()) 
            {
                if (!this._hideTipBg) 
                {
                    this._hideTipBg = ObjCreate.createBg(this._leftX + 40, this._currentY, 120, 30, null, ImagesConst.SelectedBg);
                }
                if (!this._hidedTipTxt) 
                {
                    this._hidedTipTxt = ObjCreate.createGTextField("", this._leftX + 40, this._currentY, 100, 20, null, GlobalStyle.textFormat6);
                    this._hidedTipTxt.autoSize = flash.text.TextFieldAutoSize.CENTER;
                    this._hidedTipTxt.htmlText = Language.getString(51133);
                }
                this._hidedTipTxt.y = this._currentY + 5;
                this._hideTipBg.y = this._hidedTipTxt.y;
                this._currentY = this._currentY + (this._hidedTipTxt.height + 10);
                if (!this.contains(this._hideTipBg)) 
                {
                    this.addChild(this._hideTipBg);
                }
                if (!this.contains(this._hidedTipTxt)) 
                {
                    this.addChild(this._hidedTipTxt);
                }
            }
            else 
            {
                if (this._hideTipBg && this.contains(this._hideTipBg)) 
                {
                    this.removeChild(this._hideTipBg);
                }
                if (this._hidedTipTxt && this.contains(this._hidedTipTxt)) 
                {
                    this.removeChild(this._hidedTipTxt);
                }
            }
            var loc2=this.getEqDescText();
            this._eqDescTxt.htmlText = loc2;
            this._eqDescTxt.y = this._currentY;
            this._currentY = this._currentY + this._eqDescTxt.height;
            var loc3=this.getRepairDescText();
            this._repairTxt.htmlText = loc3;
            this._repairTxt.y = this._currentY;
            this._currentY = this._currentY + this._repairTxt.height;
            var loc4=this.getSellToSysText();
            this._sellToSysTxt.htmlText = loc4;
            this._sellToSysTxt.y = this._currentY;
            this._currentY = this._currentY + this._sellToSysTxt.height;
            this._sendToChatTxt.y = this._currentY;
            this._currentY = this._currentY + this._sendToChatTxt.height;
            var loc5=this.getTipsText();
            this._tipTxt.htmlText = loc5;
            this._tipTxt.y = this._currentY;
            this._currentY = this._currentY + this._tipTxt.height;
            return;
        }

        public set data(arg1: PetEquipTooltipInfo)
        {
            this._data = arg1;
            this._itemData = arg1.itemdata;
            this._itemInfo = this._itemData ? this._itemData.itemInfo : null;
            this._itemExInfo = this._itemData ? this._itemData.itemExInfo : null;
            this._eqDataUtil = this._itemData ? new EquipmentItemDataUtil(this._itemData) : null;
            if (this._itemInfo && this._itemInfo.extend && this._itemInfo.extend is TItemWeapon) 
            {
                this._tItemWeap = this._itemInfo.extend as TItemWeapon;
            }
            this.updateUI();
            return;
        }

        /* internal  */initUI(): void
        {
            this._qualityTxt = ObjCreate.createTextField("", this._leftX - 5, 0, 60, 20, this, new GTextFormat(FontUtil.songtiName, 14, null, false));
            this._qualityTxt.autoSize = flash.text.TextFieldAutoSize.LEFT;
            this._nameTxt = ObjCreate.createTextField("", 45 + this._leftX, 0, 220, 20, this, new GTextFormat(FontUtil.songtiName, 14, null, true));
            this._nameTxt.autoSize = flash.text.TextFieldAutoSize.LEFT;
            this._lockBitmap = new Object /* flash.display.Bitmap */();
            this._lockBitmap.x = this._leftX;
            this.addChild(this._lockBitmap);
            this._bindTxt = ObjCreate.createTextField("", 25, 0, 80, 20, this, new GTextFormat(FontUtil.songtiName, 12, 65280));
            this._bindTxt.autoSize = flash.text.TextFieldAutoSize.LEFT;
            this._needLevelTxt = ObjCreate.createTextField("", 70, 17, 100, 20, this, new GTextFormat(FontUtil.songtiName, 12, 16777215));
            this._needLevelTxt.autoSize = flash.text.TextFieldAutoSize.LEFT;
            this._imageBg = GlobalClass.getBitmap(ImagesConst.PackItemBg);
            this.addChild(this._imageBg);
            this._eqItem = new BaseItem();
            this._eqItem.setSize(32, 32);
            this._eqItem.isShowToolTip = false;
            this._eqItem.isDragAble = false;
            this.addChild(this._eqItem);
            this._eqTypeTxt = ObjCreate.createTextField("", 70, 12, 100, 20, this, new GTextFormat(FontUtil.songtiName, 12, 16777215));
            this._eqTypeTxt.autoSize = flash.text.TextFieldAutoSize.LEFT;
            this._durabTxt = ObjCreate.createTextField("", 70, 28, 100, 20, this, new GTextFormat(FontUtil.songtiName, 12, 16777215));
            this._durabTxt.autoSize = flash.text.TextFieldAutoSize.LEFT;
            this._equipStar = new PetEquipStars();
            this._equipStar.starMode = PetEquipStars.StarSmall;
            this._equipStar.x = this._leftX;
            this.addChild(this._equipStar);
            this._basicPropTxt = ObjCreate.createTextField("", this._leftX, 0, 100, 20, this, new GTextFormat(FontUtil.songtiName, 12, 16777215));
            this._basicPropTxt.autoSize = flash.text.TextFieldAutoSize.LEFT;
            this._baseLine = ObjCreate.createBg(0, 0, this._lineWidth, 1, this, ImagesConst.SeptalLine);
            this._addtionalPropTxt = ObjCreate.createTextField("", this._leftX, 0, 120, 20, this, new GTextFormat(FontUtil.songtiName, 12, 16777215));
            this._addtionalPropTxt.autoSize = flash.text.TextFieldAutoSize.LEFT;
            this._addLine = ObjCreate.createBg(0, 0, this._lineWidth, 1, this, ImagesConst.SeptalLine);
            this._gemTxt = ObjCreate.createTextField(Language.getString(51085), this._leftX, 0, 100, 20, this, new GTextFormat(FontUtil.songtiName, 12, 16678144));
            this._gemTxt.autoSize = flash.text.TextFieldAutoSize.LEFT;
            this._gemSprite = ObjCreate.createSprite();
            this._gemSprite.x = this._leftX + 10;
            this.addChild(this._gemSprite);
            this._gemLine = ObjCreate.createBg(0, 0, this._lineWidth, 1, this, ImagesConst.SeptalLine);
            this._eqDescTxt = ObjCreate.createTextField("", this._leftX, this._currentY, 185, 20, this, new GTextFormat(FontUtil.songtiName, 12, 16777215));
            this._eqDescTxt.autoSize = flash.text.TextFieldAutoSize.LEFT;
            this._eqDescTxt.wordWrap = true;
            this._eqDescTxt.multiline = true;
            this._repairTxt = ObjCreate.createTextField("", this._leftX, this._currentY, 200, 20, this, new GTextFormat(FontUtil.songtiName, 12, 16777215));
            this._repairTxt.autoSize = flash.text.TextFieldAutoSize.LEFT;
            this._sellToSysTxt = ObjCreate.createTextField("", this._leftX, this._currentY, 200, 20, this, new GTextFormat(FontUtil.songtiName, 12, 15319853));
            this._sellToSysTxt.autoSize = flash.text.TextFieldAutoSize.LEFT;
            this._sendToChatTxt = ObjCreate.createTextField("", this._leftX, this._currentY, 200, 20, this, new GTextFormat(FontUtil.songtiName, 12, 16777215));
            this._sendToChatTxt.autoSize = flash.text.TextFieldAutoSize.LEFT;
            this._sendToChatTxt.text = Language.getString(51086);
            this._tipTxt = ObjCreate.createTextField("", this._leftX, this._currentY, 200, 20, this, new GTextFormat(FontUtil.songtiName, 12, 51429));
            this._tipTxt.autoSize = flash.text.TextFieldAutoSize.LEFT;
            return;
        }

        /* internal  */getQualityName(): string
        {
            var loc2=null;
            var loc3=null;
            var loc4=null;
            var loc1="";
            if (this._itemExInfo) 
            {
                if (this._tItemWeap && this._tItemWeap.color > EColor._EColorWhite) 
                {
                    loc3 = GameDefConfig.instance.getEPrefixx(this._itemExInfo.prefix, this._tItemWeap.type);
                    if (loc3) 
                    {
                        loc2 = loc3.name;
                    }
                    loc4 = ColorConfig.instance.getItemColorString(this._tItemWeap.color);
                    loc1 = HTMLUtil.addColor("[" + loc2 + "]", loc4);
                }
            }
            return loc1;
        }

        /* internal  */getStrengName(): string
        {
            var loc2=null;
            var loc1="";
            if (this._tItemWeap && this._itemExInfo && this._itemExInfo.strengthen > 0) 
            {
                loc2 = ColorConfig.instance.getItemColorString(this._tItemWeap.color);
                loc1 = HTMLUtil.addColor(" +" + this._itemExInfo.strengthen, loc2);
            }
            return loc1;
        }

        public getNameText(): string
        {
            var loc3=null;
            var loc1="";
            var loc2="#FFFF00";
            if (this._tItemWeap) 
            {
                loc1 = this._tItemWeap.name;
                loc2 = ColorConfig.instance.getItemColorString(this._tItemWeap.color);
            }
            if (ParamsConst.instance.proxyType == ProxyType.TW && !(ParamsConst.instance.gameName == null)) 
            {
                if (loc1.indexOf(ParamsConst.instance.gameName) >= 0) 
                {
                    loc3 = new RegExp(ParamsConst.instance.gameName, "g");
                    loc1 = loc1.replace(loc3, "");
                }
            }
            return HTMLUtil.addColor(loc1, loc2);
        }

        /* internal  */getBind(): int
        {
            var loc1=0;
            if (this._tItemWeap) 
            {
                loc1 = this._tItemWeap.bind;
                if (this._itemExInfo && !(this._itemExInfo.bind == 0)) 
                {
                    loc1 = this._itemExInfo.bind;
                }
            }
            return loc1;
        }

        /* internal  */getNeedLevelStr(): string
        {
            var loc1=Language.getString(61315) + "：";
            var loc2="#ffffff";
            loc1 = loc1 + Language.getStringByParam(28023, PetUtil.getRebornTimes(this._tItemWeap.level), PetUtil.getLevel(this._tItemWeap.level));
            return HTMLUtil.addColor(loc1, loc2);
        }

        /* internal  */getEqType(): string
        {
            var loc2=null;
            var loc1="";
            if (this._tItemWeap) 
            {
                loc2 = GameDefConfig.instance.getEPetEquipDef(this._tItemWeap.type);
                if (loc2) 
                {
                    loc1 = loc2.name;
                }
            }
            return HTMLUtil.addColor(loc1, "#FFFFFF");
        }

        /* internal  */getDurab(): string
        {
            var loc1=Language.getString(51091);
            var loc2="#ffffff";
            if (this._itemExInfo) 
            {
                loc1 = loc1 + (this._itemExInfo.durable + "/" + this._tItemWeap.durableUpper);
                if (this._itemExInfo.durable == 0) 
                {
                    loc2 = "#ff0000";
                }
            }
            else 
            {
                loc1 = loc1 + (this._tItemWeap.durable + "/" + this._tItemWeap.durableUpper);
                if (this._tItemWeap.durable == 0) 
                {
                    loc2 = "#ff0000";
                }
            }
            return HTMLUtil.addColor(loc1, loc2);
        }

        /* internal  */getEquipStar(): int
        {
            if (this._itemExInfo) 
            {
                return this._itemExInfo.p_equip_star;
            }
            return 0;
        }

        public getBasicProps(): string
        {
            var loc4=null;
            var loc5=null;
            var loc6=0;
            var loc7=null;
            var loc8=0;
            if (!this._eqDataUtil) 
            {
                return "";
            }
            var loc1="";
            var loc2=this._eqDataUtil.getBasePropArray();
            if (loc2.length > 0) 
            {
                loc1 = HTMLUtil.addColor(Language.getString(51092), "#fe7d00");
            }
            var loc3=0;
            while (loc3 < loc2.length) 
            {
                loc5 = (loc4 = loc2[loc3] as Map<any, any> /* flash.utils.Dictionary */)["name"];
                loc6 = loc4["value"];
                loc7 = "";
                if (this._itemExInfo && (this._itemExInfo.p_equip_star > 0 || this._itemExInfo.strengthen > 0)) 
                {
                    if ((loc8 = this._eqDataUtil.getPetEquipStarAddValue(loc4["type"]) + this._eqDataUtil.getBaseAdditive(loc4["baseValue"])) > 0) 
                    {
                        loc7 = "+" + loc8;
                    }
                }
                if (loc5.length != 2) 
                {
                    loc1 = loc1 + ("\r    " + loc5 + "    " + loc6 + loc7);
                }
                else 
                {
                    loc1 = loc1 + ("\r    " + loc5 + "        " + loc6 + loc7);
                }
                ++loc3;
            }
            if (loc1 != "") 
            {
                loc1 = "<textFormat leading=\'5\'>" + HTMLUtil.addColor(loc1, "#ffffff") + "</textFormat>";
            }
            return loc1;
        }

        public getAddtionalProps(): string
        {
            var loc3=0;
            var loc7=null;
            var loc8=null;
            var loc9=0;
            var loc10=0;
            var loc11=null;
            var loc12=0;
            var loc13=0;
            var loc14=null;
            var loc15=0;
            if (!this._tItemWeap) 
            {
                return "";
            }
            var loc1="";
            var loc2="";
            var loc4=false;
            var loc5;
            if ((loc5 = this._eqDataUtil.getAddtionalArray()).length == 0 && this._tItemWeap.color > 1) 
            {
                loc4 = true;
                loc2 = HTMLUtil.addColor(Language.getString(51094), "#7c7c7c");
            }
            if (this._tItemWeap.color > 1) 
            {
                loc1 = HTMLUtil.addColor(Language.getString(51095), "#fe7d00") + loc2;
            }
            var loc6=0;
            while (loc6 < loc5.length) 
            {
                loc7 = loc5[loc6] as Map<any, any> /* flash.utils.Dictionary */;
                if (!loc4) 
                {
                    loc8 = loc7["name"];
                    loc9 = loc7["value"];
                    loc10 = loc7["star"];
                    loc11 = "";
                    loc12 = loc9;
                    loc13 = 5 - loc12.toString().length;
                    loc14 = "";
                    loc15 = 0;
                    while (loc15 < loc13) 
                    {
                        loc14 = loc14 + " ";
                        ++loc15;
                    }
                    loc11 = loc14 + Language.getStringByParam(51096, loc10);
                    if (loc8.length != 2) 
                    {
                        loc1 = loc1 + ("\r    " + loc8 + "    " + loc12 + loc11);
                    }
                    else 
                    {
                        loc1 = loc1 + ("\r    " + loc8 + "        " + loc12 + loc11);
                    }
                }
                ++loc6;
            }
            if (loc1 != "") 
            {
                loc1 = "<textFormat leading=\'5\'>" + HTMLUtil.addColor(loc1, "#00ff00") + "</textFormat>";
            }
            return loc1;
        }

        /* internal  */getInlay(): string
        {
            var loc1=HTMLUtil.addColor(Language.getString(51097), "#fe7d00");
            if (this._itemData.color <= EColor._EColorBlue) 
            {
                loc1 = loc1 + HTMLUtil.addColor(Language.getString(61357), "#7c7c7c");
            }
            else if (this._itemExInfo && this._itemExInfo.hole1 <= 1 && this._itemExInfo.hole2 <= 1 && this._itemExInfo.hole3 <= 1 && this._itemExInfo.hole4 <= 1 && this._itemExInfo.hole5 <= 1 && this._itemExInfo.hole6 <= 1) 
            {
                loc1 = loc1 + HTMLUtil.addColor(Language.getString(51099), "#7c7c7c");
            }
            return loc1;
        }

        public updateGemSprite(): void
        {
            DisplayUtil.removeAllChild(this._gemSprite);
            if (this._data.isShowInlayAttr == false) 
            {
                return;
            }
            if (this._itemExInfo) 
            {
                this.addGemByHold(this._gemSprite, this._itemExInfo.hole1, 1);
                this.addGemByHold(this._gemSprite, this._itemExInfo.hole2, 2);
                this.addGemByHold(this._gemSprite, this._itemExInfo.hole3, 3);
                this.addGemByHold(this._gemSprite, this._itemExInfo.hole4, 4);
                this.addGemByHold(this._gemSprite, this._itemExInfo.hole5, 5);
            }
            return;
        }

        public addGemByHold(arg1: Object /* flash.display.Sprite */, arg2: int, arg3: int, arg4: Boolean=false): void
        {
            var loc1=null;
            var loc2=null;
            var loc6=null;
            var loc7=null;
            var loc8=null;
            var loc3="";
            var loc4="";
            var loc5="";
            if (arg2 != 0) 
            {
                if (arg2 != 1) 
                {
                    if (arg2 > 1) 
                    {
                        (loc1 = GlobalClass.getBitmap("HoleBg")).y = this._currentY;
                        arg1.addChild(loc1);
                        loc2 = new BaseItem();
                        loc7 = new ItemData(arg2);
                        loc2.itemData = loc7;
                        if (loc7 && loc7.itemInfo && loc7.itemInfo.item) 
                        {
                            loc3 = loc7.itemInfo.item.name;
                            if (loc8 = GameDefConfig.instance.getEJewel(loc7.itemInfo.item.type)) 
                            {
                                loc4 = loc8.name;
                            }
                            loc5 = loc7.itemInfo.item.effect.toString();
                        }
                        loc2.x = loc1.x;
                        loc2.y = loc1.y;
                        loc2.setSize(22, 22);
                        loc2.drawNow();
                        arg1.addChild(loc2);
                        (loc6 = ObjCreate.createGTextField("", loc1.x + loc1.width + 2, loc1.y + 2, 150, 20, arg1, this._gemTf)).htmlText = loc3 + " " + loc4 + "+" + loc5;
                        loc6.autoSize = flash.text.TextFieldAutoSize.LEFT;
                        arg1.addChild(loc6);
                        this._currentY = this._currentY + (loc1.height + 3);
                    }
                }
                else 
                {
                    (loc1 = GlobalClass.getBitmap("HoleBg")).y = this._currentY;
                    arg1.addChild(loc1);
                    (loc6 = ObjCreate.createGTextField("", loc1.x + loc1.width + 2, loc1.y + 2, 150, 20, arg1, this._gemTf)).htmlText = HTMLUtil.addColor(Language.getString(51101), "#7c7c7c");
                    loc6.autoSize = flash.text.TextFieldAutoSize.LEFT;
                    arg1.addChild(loc6);
                    this._currentY = this._currentY + (loc1.height + 3);
                }
            }
            else 
            {
                (loc1 = GlobalClass.getBitmap("HoleBg")).y = this._currentY;
                arg1.addChild(loc1);
                ObjCreate.createBitmap(ImagesConst.HideHole, 3, this._currentY + 3, arg1);
                loc6 = ObjCreate.createGTextField("", loc1.x + loc1.width + 2, loc1.y + 2, 150, 20, arg1, this._gemTf);
                if (arg3 >= 0 && arg3 <= 3) 
                {
                    loc6.htmlText = Language.getString(61359);
                }
                else if (arg3 != 4) 
                {
                    if (arg3 == 5) 
                    {
                        loc6.htmlText = Language.getString(61361);
                    }
                }
                else 
                {
                    loc6.htmlText = Language.getString(61360);
                }
                loc6.autoSize = flash.text.TextFieldAutoSize.LEFT;
                arg1.addChild(loc6);
                this._currentY = this._currentY + (loc1.height + 3);
            }
            return;
        }

        public getEqDescText(): string
        {
            var loc1="";
            if (this._tItemWeap) 
            {
                if (!(this._tItemWeap.descStr == "") && !(this._tItemWeap.descStr == "0")) 
                {
                    loc1 = "<textFormat leading=\'5\'>" + HTMLUtil.addColor(Language.getString(51102) + this._tItemWeap.descStr, "#ffffff") + "</textFormat>";
                }
            }
            return loc1;
        }

        public getRepairDescText(): string
        {
            var loc3=null;
            var loc4=null;
            var loc1="";
            var loc2="";
            if (this._tItemWeap) 
            {
                if (this._tItemWeap.specialRepairNeedAmount != 0) 
                {
                    loc3 = "";
                    if ((loc4 = ItemConfig.instance.getInfoByCode(this._tItemWeap.specialRepairNeedItem)) && loc4.item) 
                    {
                        loc3 = loc4.item.name;
                    }
                    loc2 = Language.getString(51103) + this._tItemWeap.specialRepairNeedAmount + loc3;
                }
            }
            if (loc2 != "") 
            {
                loc1 = HTMLUtil.addColor(loc2, "#60e71e");
            }
            return loc1;
        }

        public getSellToSysText(): string
        {
            var loc3=null;
            var loc1="";
            var loc2="";
            if (this._tItemWeap) 
            {
                if (this._tItemWeap.sell == 1) 
                {
                    loc3 = GameDefConfig.instance.getEPrictUnitName(this._tItemWeap.sellUnit);
                    loc2 = this._tItemWeap.sellPrice + "\t" + loc3;
                }
            }
            if (loc2 != "") 
            {
                loc1 = Language.getString(51104) + loc2;
            }
            return loc1;
        }

        /* internal  */getTipsText(): string
        {
            var loc1="";
            var loc2="";
            var loc3=this._itemExInfo ? this._itemExInfo.p_equip_star : 0;
            var loc4=this._itemData ? this._itemData.color : 0;
            if (loc3 < 10) 
            {
                loc2 = Language.getString(61338);
            }
            else if (loc4 < EColor._EColorOrange) 
            {
                loc2 = Language.getString(61339);
            }
            if (loc2 != "") 
            {
                loc1 = Language.getString(51110) + loc2;
            }
            return loc1;
        }

        public get data(): PetEquipTooltipInfo
        {
            return this._data;
        }

        public get itemData(): ItemData
        {
            return this._itemData;
        }

        public set itemData(arg1: ItemData)
        {
            this._itemData = arg1;
            return;
        }

        /* internal */ /* var */_tipTxt: Object /* flash.text.TextField */;

        /* internal */ /* var */_hideTipBg: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_hidedTipTxt: GTextFiled;

        /* internal */ /* var */_data: PetEquipTooltipInfo;

        /* internal */ /* var */_bindTxt: Object /* flash.text.TextField */;

        /* internal */ /* var */_itemInfo: ItemInfo;

        /* internal */ /* var */_itemExInfo: ItemExInfo;

        /* internal */ /* var */_tItemWeap: TItemWeapon;

        /* internal */ /* var */_eqDataUtil: EquipmentItemDataUtil;

        /* internal */ /* var */_lineWidth: int=210;

        /* internal */ /* var */_leftX: int=10;

        /* internal */ /* var */_itemData: ItemData;

        /* internal */ /* var */_currentY: int=10;

        /* internal */ /* var */_qualityTxt: Object /* flash.text.TextField */;

        /* internal */ /* var */_nameTxt: Object /* flash.text.TextField */;

        /* internal */ /* var */_lockBitmap: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_needLevelTxt: Object /* flash.text.TextField */;

        /* internal */ /* var */_imageBg: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_eqItem: BaseItem;

        /* internal */ /* var */_eqTypeTxt: Object /* flash.text.TextField */;

        /* internal */ /* var */_durabTxt: Object /* flash.text.TextField */;

        /* internal */ /* var */_equipStar: PetEquipStars;

        /* internal */ /* var */_basicPropTxt: Object /* flash.text.TextField */;

        /* internal */ /* var */_baseLine: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_gemTf: GTextFormat;

        /* internal */ /* var */_addtionalPropTxt: Object /* flash.text.TextField */;

        /* internal */ /* var */_repairTxt: Object /* flash.text.TextField */;

        /* internal */ /* var */_addLine: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_gemTxt: Object /* flash.text.TextField */;

        /* internal */ /* var */_gemSprite: Object /* flash.display.Sprite */;

        /* internal */ /* var */_gemLine: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_eqDescTxt: Object /* flash.text.TextField */;

        /* internal */ /* var */_sellToSysTxt: Object /* flash.text.TextField */;

        /* internal */ /* var */_sendToChatTxt: Object /* flash.text.TextField */;
    }
